<?php 
namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Nav extends Model
{
	protected $table = 'nav';

	protected $fillable = ['href',  'name', 'sort'];

	public $timestamps = false;

	public static function Get_List()
	{
		return Nav::orderBy('sort', 'asc')->get();
	}

	public static function Add($data)
	{	
		return Nav::create($data);
	}

	public static function Update_Nav($id, $data)
	{	
		return Nav::where('id', '=', $id)->update($data);
	}

	public static function Destroy_Nav($id)
	{	
		return Nav::destroy($id);
	}

	public function freshTimestamp()
	{
        		return time();
    	}

    	public function fromDateTime($value)
    	{
        		return $value;
    	}

    	public function getDateFormat()
    	{
        		return 'U';
    	}
}